home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 215 / 215.d81 / modstar copier (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  290 lines

  1. 10 dv=peek(186):if dv<8 then dv=8
  2. 20 close15:open15,dv,15,"i":close15
  3. 100 poke147,0:sys57812"mod copier.o",dv,1:sys62631
  4. 105 goto305
  5. 106 dv=peek(186):if dv<8 then dv=8:rem  dv defined again because of clr command
  6. 107 close15:open15,dv,15,"i":close15
  7. 110 sys sd,dn$,bf%,nf%,fi$(.),nb%(.),ft%(.),s%(.),tr%(.),se%(.),l$(.):return
  8. 115 rem issued in line 305
  9. 120 poke214,4:print:printtab(11)"[154]"s$(cs)
  10. 125 print"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,2
  11. 130 poke214,6:print:fora=1to14
  12. 135 print"                                        "
  13. 140 next
  14. 143 close15:open15,dv,15,"i":close15
  15. 145 return
  16. 150 poke214,21:print
  17. 155 fora=1to2:print"                                       ":next
  18. 160 print"[145][145]";:return
  19. 165 b=.:fora=8to11:open15,a,15:close15
  20. 170 d(a-7)=.:ifst=.thend(a-7)=a:b=b+1
  21. 175 next:fora=1to4:ifd(a)<>.thensd%=d(a):a=4
  22. 180 next:ifb=1thentd%=sd%:return
  23. 185 fora=sd%-6to4:ifd(a)<>.thentd%=d(a):a=4
  24. 190 next:return
  25. 195 hi=int(a/256):lo=a-hi*256:return
  26. 200 open15,sd%,15,"i0":input#15,er,er$,tr,se:close15:ok=-1:ifer=.thenreturn
  27. 205 poke214,15:print:fora=1to3:print"                                      "
  28. 210 next:print"[145][145][145]          --- drive error ---"
  29. 215 a$="error:"+str$(er)+" "+er$:printtab((20-len(a$)/2)+1)a$
  30. 220 print"[154]       track:"tr;tab(23)"[154]sector:"se:ok=not(ok):return
  31. 225 gosub150:print"        [154]press space [154]to return to"
  32. 230 print"             the main menu":poke198,.
  33. 235 ifpeek(203)<>60then235
  34. 240 return
  35. 245 s$(1)="  view directory  "
  36. 250 s$(2)="    copy files    "
  37. 255 s$(3)="  scratch  files  "
  38. 260 s$(4)="   disk command   "
  39. 265 s$(5)="   quit program   "
  40. 270 :
  41. 275 m$(1)="1. view directory"
  42. 280 m$(2)="2. copy files    "
  43. 285 m$(3)="3. scratch files "
  44. 290 m$(4)="4. disk command  "
  45. 295 m$(5)="5. quit program  "
  46. 300 return
  47. 305 poke55,.:poke56,64:clr:poke650,128
  48. 306 dv=peek(186):if dv<8 then dv=8:rem  dv defined again because of clr command
  49. 307 close15:open15,dv,15,"i":close15
  50. 310 poke53280,2:poke53281,.:co=54272
  51. 315 op=16384:ni=op+29:en=op+176:rem op  is the start address of copier.o
  52. 320 sl=16754:up=17633:dn=up+3
  53. 325 re=17903:wr=18269:sd=18420
  54. 330 dim fi$(144),nb$(144),ft%(144),s%(144),l$(144),nf%,ns%,tr%(144),se%(144)
  55. 335 dim sa(145)
  56. 340 cs=1:ns=5:dim m$(ns),s$(ns),d(4)
  57. 345 t$(.)="del":t$(5)=" deleted  "
  58. 350 t$(1)="seq":t$(6)="sequential"
  59. 355 t$(2)="prg":t$(7)=" program  "
  60. 360 t$(3)="usr":t$(8)="   user   "
  61. 365 t$(4)="rel":t$(9)=" relative "
  62. 370 sp$="                "
  63. 375 printchr$(142)"[147]              [158]star copier"
  64. 380 print"            by mike maynard"
  65. 385 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  66. 390 gosub245:gosub165
  67. 395 ifflthenpoke214,21:print:goto435
  68. 400 gosub130:print"               [154]main menu              "
  69. 405 print"[158][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":poke1303,100:pokeco+1303,7
  70. 410 fora=1tons+2
  71. 415 print"[150]                                        ";:next
  72. 420 print"[146][158][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1623,99:poke1623+co,7
  73. 425 poke214,20:print
  74. 430 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke1903,99:poke1903+co,2
  75. 435 print"    [154]use the cursor keys [154]to move the"
  76. 440 print" reversed area. press return [154]to select.":ifflthen470
  77. 445 fora=217to242:pokea,peek(a)or128:next:poke214,7:print
  78. 450 fora=1tons
  79. 455 ifa=csthenprinttab(11)""m$(a):goto465
  80. 460 printtab(11)"[150]"m$(a)
  81. 465 next
  82. 470 poke214,15:print:print"                                      [145]"
  83. 475 print"        source device number:[153]"sd%:pokeop+3,sd%
  84. 480 print"                                      "
  85. 485 poke214,17:print:print"                                      [145]"
  86. 490 print"        target device number:[153]"td%
  87. 495 print"                                     ":ifflthen510
  88. 500 poke214,6+ls:print:printtab(11)"[150]"m$(ls)
  89. 505 poke214,6+cs:print:printtab(11)""m$(cs)
  90. 510 ls=cs:fl=.
  91. 515 a=peek(203):ifa<>13anda<>22anda<>1anda<>7anda<>2then515
  92. 520 ifa=1then on cs goto595 ,790,1090,1180,1240
  93. 525 ifa=13ora=22then565
  94. 530 if(peek(653)and1)then550
  95. 535 ifa=7thencs=cs+1:ifcs>nsthencs=1
  96. 540 ifa=2thencs=cs-1:ifcs=.thencs=ns
  97. 545 goto500
  98. 550 ifa=7thencs=cs-1:ifcs=.thencs=ns
  99. 555 ifa=2thencs=cs+1:ifcs>nsthencs=1
  100. 560 goto500
  101. 565 ifa=13thensd%=sd%+1:ifsd%=12thensd%=8
  102. 570 ifa=22thentd%=td%+1:iftd%=12thentd%=8
  103. 575 ifd(sd%-7)=.ord(td%-7)=.then565
  104. 580 poke214,15:print:printtab(29)"[153]"sd%"[157] ":pokeop+3,sd%
  105. 585 poke214,17:print:printtab(29)"[153]"td%"[157] "
  106. 590 goto515
  107. 595 gosub200:ifnot(ok)thenfl=1:goto785
  108. 600 poke1020,8:poke1021,1:poke1022,40:poke1023,14
  109. 605 gosub120:gosub150:print"           [154]press:  p[154] to pause"
  110. 610 print"                   a[154] to abort"
  111. 615 poke214,6:print:sys(op)
  112. 620 sys(ni),dn$,bf%:bf$=str$(bf%):bf$=right$("00"+right$(bf$,len(bf$)-1),3)
  113. 625 id$=right$(dn$,2):dn$=left$(dn$,16):poke1020,9:poke1023,13
  114. 630 poke214,4:print:print"[154]  disk name:"dn$tab(33)"[154]id:"id$"[153]":bu%=.:nf%=.
  115. 635 print" [158]blks[221] [158]type [221]    [158]filename     [221][158]trk [221][158]sec":ln%=1:poke198,.
  116. 640 sys(en),fi$,nb%,ft%
  117. 645 s=.:ifft%<5thens=1
  118. 650 ft%=ft%and127
  119. 655 nb$="   "+str$(nb%):nb$=right$(nb$,3):ifft%<1then690
  120. 660 bu%=bu%+nb%:nf%=nf%+1:ln%=ln%+1:ifln%>14thenln%=14:sysup:print"[145][145]"
  121. 665 tr$=right$(" "+str$(peek(re+3)),2):se$=right$(" "+str$(peek(re+4)),2)
  122. 670 print" [153]"nb$" [221] ";:if(ft%and64)thenft%=ft%and63:print"[157][156]>";
  123. 675 print" ";:if(s)thenprint"[157]*";
  124. 680 print"[153]"t$(ft%and15)" [221][153]";:poke212,1:printleft$(fi$+sp$,16);
  125. 685 poke212,.:print" [221][153] "tr$" [221][153] "se$
  126. 690 geta$:ifa$<>"a"anda$<>"p"then745
  127. 695 ifa$="a"then725
  128. 700 cl=peek(214):gosub150:print"         [158]view directory paused"
  129. 705 print"        [154]press space [154]to continue":poke198,.
  130. 710 ifpeek(203)<>60then710
  131. 715 gosub150:print"           [154]press:  p[154] to pause"
  132. 720 print"                   a[154] to abort[153]":poke214,cl-1:print:goto745
  133. 725 ifln%<13then735
  134. 730 forb=1to((ln%=13)*-1+(ln%=14)*-2):sysup:print"[145][145]":next
  135. 735 print"         [150]view directory aborted!":ln%=ln%+2:ifln%>14thenln%=14
  136. 740 close3:close15:bu$="???":ot$=bu$:nf$=bu$:goto765
  137. 745 ifpeek(2)=.then640
  138. 750 bu$=str$(bu%):bu$=right$("00"+right$(bu$,len(bu$)-1),3)
  139. 755 ot$=str$(664-bf%-bu%):ot$=right$("00"+right$(ot$,len(ot$)-1),3)
  140. 760 nf$=str$(nf%):nf$=right$("00"+right$(nf$,len(nf$)-1),3)
  141. 765 ifln%<13then775
  142. 770 forb=1to((ln%=13)*-2+(ln%=14)*-3):sysup:print"[145][145]":next
  143. 775 print" [158]blocks->[154]free:"bf$"  [154]used:"bu$"  [154]other:"ot$
  144. 780 print"[154]       total number of files:"nf$
  145. 785 poke1020,8:poke1023,14:gosub225:goto395
  146. 790 gosub1340:ifnot(ok)then785
  147. 795 gosub1310
  148. 800 gosub120:poke214,6:print
  149. 805 fora=1to14:printtab(19)"[221]":next
  150. 810 poke214,6:print:printtab(5)"[158]reading:"tab(26)"writing:":c1%=.:c2%=.
  151. 815 cf%=1:f%=.:ln%=.:ap%=.:fu%=.
  152. 820 bf%=1:sa(1)=24458:poke214,c1%+7:print                              
  153. 825 poke1020,9:poke1021,1:poke1022,18:poke1023,13
  154. 830 ifs%(cf%)=.then920
  155. 835 ifft%(cf%)>4then865
  156. 840 ifc1%>11thenforb=1to((c1%=12)*-1+(c1%=13)*-2):sysup:print"[145][145]":next
  157. 845 c1%=c1%+1:s%(cf%)=.:a$=fi$(cf%):print
  158. 850 print"[145]"tab(10-len(a$)/2)"[150]"a$:printtab(2)"can't copy splat"
  159. 855 ns%=ns%-1:ifns%=.then1055
  160. 860 goto920
  161. 865 c1%=c1%+1:if(c1%>13)and(fu%=.)thenc1%=13:sysup:print"[145][145]"
  162. 870 if(fu%)thenprint"[145][145]"
  163. 875 a$=fi$(cf%):printtab(10-len(a$)/2)""a$
  164. 880 a=sa(bf%):gosub195:poke2